﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>编辑会员信息</title>
<link href="../../Client/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="../css/admin.css" rel="stylesheet" type="text/css" />
<script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="../js/function.js" type="text/javascript"></script>
<script src="../js/base.js" type="text/javascript"></script>
<script src="../js/dialog.js" type="text/javascript"></script>
<script src="../js/jquery-form.js" type="text/javascript"></script>
<script src="../js/ajax-data.js" type="text/javascript"></script>
<script src="../js/Pager.js" type="text/javascript"></script>
<style>
.foot_btn_box{ text-align:left; margin-left:200px;}
li.selected {height:23px;}
.selected a:hover{ text-decoration:none;}
td input {width:300px; padding-left:5px;}
table{border-collapse: collapse;border: none; text-align:center;}
.list{ min-width:700px;}
.list td{border: solid #ccc 1px;color:Black; height:26px;}

/*分页*/
.pager_style{width:100%;height:30px;margin-top:10px;text-align:left;color:#909090;}
.pager_style li{font-size:14px;}
.pager_style .page_num{height:100%;font-size:0;display:inline-block; float:left;}
.pager_style .page_num li{height:100%;border:1px solid #eeeeee;padding:0 10px;margin-right:5px;line-height:30px;display:inline-block;cursor:pointer;float:left;}
.pager_style .page_num li:hover{border:1px solid #f37b0b;background-color:#f37b0b;color:White;}

/*分页 选中当页样式*/
.pager_style .page_num .active{border:1px solid #f37b0b;background-color:#f37b0b;color:White;cursor:default;}
/*分页 不可用样式*/
.pager_style .page_num .disable{background-color:#f1f1f1;}
.pager_style .page_num .disable:hover{border:1px solid #eeeeee;background-color:#f1f1f1;color:#909090;}

.pager_style .page_info{display:none;float:left;}
.pager_style .page_info li{display:inline-block;margin-left:10px;float:left;line-height: 30px;}
</style>
</head>
<body class="mainbody">
<form id="form1" runat="server">
<div class="navigation"><a href="javascript:" class="back">后退</a>首页 &gt; 微街秀代理商 &gt; 代理商信息</div>
<div id="tab">
    <ul class="tab_nav">
        <li class="selected"><a id="tab1" onclick="tabs('#tab',0);" href="javascript:;">基本信息</a></li>
        <li><a  href="javascript:" onclick="tabs('#tab',1);">操作权限</a></li>       
    </ul>

    <div class="tab_con" style="display:block;">
        <table class="form_table">
            <col width="150px"><col>
            <tbody>          
            <tr>
                <th>账号：</th>
                <td><span id="name"></span></td>
            </tr>
            <tr>
                <th>密码：</th>
                <td><input type="password" id="pwd" /></td>
            </tr>
            <tr>
                <th>确认密码：</th>
                <td><input type="password" id="pwd2" /></td>
            </tr>
            <tr>
                <th>真实姓名：</th>
                <td>
                   <input type="text" id="truename" />
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="tab_con">
        <table class="list">
            <tr class="th">
                <td>微街秀ID</td>
                <td style="width:260px">公司名</td>
                <td>QD名称</td>
                <td style="width:60px">类别</td>
                <td>内容</td>
                <td style="width:100px">时间</td>
            </tr>
            <tbody id="list"></tbody>
        </table>        
         <div class="pager_style">
            <ul class="page_num"></ul>
            <ul class="page_info">
                <li>总数:<span id="count">0</span></li>
                <li>每页:<span id="pageSize">0</span></li>
                <li>页数:<span id="pageToal">0</span></li>
            </ul>
        </div>
    </div>

    <div class="foot_btn_box">
        <input type="button" value=" 提 交 " onclick="submits()" />
    </div>
</div>
</form>
<script>
    var id = 0;
    $(function () {
        id = getQueryString("id");
        $("#name").html(getCookie("adminname"));
        //指定显示选项卡
        if (location.href.indexOf("#tab1") > -1) {
            tabs('#tab', 1);
        }
        Get();
    });

    function Get() {
        if (id == null) {
            id = getCookie("adminid");
            return;
        }
        var param = "&id=" + id;
        AjaxStart("../ajax/admin.ashx?get", param, function (data) {
            if (data.code != 0) {
                Alert(data.msg);
            }
            else {
                $("#adminname").val(data.item.adminname);
            }
        });
    }

    function submits() {
        if (!check())
            return false;

        var param = "id=" + id + "&pwd=" + trim($("#pwd").val()) + "&pwd2=" + trim($("#pwd2").val());
        AjaxStart("../ajax/admin.ashx?editpass", param, function (data) {
            if (data.code != 0) {
                Alert(data.msg)
            }
            else {
                Alert("修改成功，请重新登录");
                delCookie("adminid");
                delCookie("adminname");
                setTimeout(function () {
                    window.parent.location.href = '../login.html';
                }, 1000);
            }
        });
    }

    function check() {
        if (id == null || id == "") {
            Alert("管理员参数无效");
            return false;
        }
        if (getCookie("adminname") == null) {
            Alert("请重新登录");
            return false;
        }
        var pwd = trim($("#pwd").val());
        var pwd2 = trim($("#pwd2").val());
        if (pwd == "") {
            Alert("请输入密码");
            return false;
        }
        if (pwd2 == "") {
            Alert("请输入确认密码");
            return false;
        }
        if (pwd != pwd2) {
            Alert("两次密码不一致");
            return false;
        }
        return true;
    }
</script>
</body>
</html>
